﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UC_Chitietsanpham.ascx.cs"
    Inherits="Controls_UC_Chitietsanpham" %>
<div id="Breadcrumb">
    <ul>
        <li><a href="Trangchu.aspx">Trang chủ</a></li>
        <li><a href="Sanpham.aspx">Sản phẩm</a></li>
        <li>
            <asp:Literal ID="ltrTitle" runat="server"></asp:Literal>
        </li>
    </ul>
</div>
<div class="chitiet-sp-content">
    <asp:ListView ID="ListView1" runat="server" OnItemCommand="ListView1_ItemCommand">
        <ItemTemplate>
            <div class="hinhsp">
                <%--<img alt="" src='<%#Eval("Image") %>'>--%>
                <asp:Image ID="Image1" ImageUrl='<%#Eval("Image") %>' runat="server" />
            </div>
            <div class="thongtin">
                <p id="thuonghieu">
                    Thương hiệu
                    <img alt="" src='<%#ThuongHieu(Eval("Id").ToString()) %>'></p>
                <p id="tensp">
                    <asp:Label ID="lblTenSanPham" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
                    <p id="gia">
                        Giá: <span>
                            <asp:Label ID="lblGia" runat="server" Text='<%#Eval("Price")%>'></asp:Label>
                            <p id="soluong">
                                Số lượng:
                                <input id="btnSub" type="button" onclick="SubSoluong()" value="-" /><asp:TextBox
                                    ID="txtSoLuong" runat="server" Height="17" CssClass="txtSoluong" ReadOnly="False"
                                    Text="1"></asp:TextBox><input id="btnAdd" type="button" onclick="AddSoluong()" value="+" />
                            </p>
                            <p id="them-gh">
                                <asp:Button ID="btnMuaHang" runat="server" UseSubmitBehavior="True" CommandName="MuaHang"
                                    CausesValidation="True" CssClass="btnMuaHang" CommandArgument='<%#Eval("Id") %>'
                                    Text="Mua hàng" /></p>
                            <p>
                            </p>
                            <h3>
                                Đặc điểm nổi bậc</h3>
                            <p>
                            </p>
                            <p>
                                    <%#Eval("Detail") %></p>
                            
            </div>
            <div class="clear">
            </div>
        </ItemTemplate>
    </asp:ListView>
</div>
<div class="main-items">
    <div class="tieude-items">
        <h4>
            Sản phẩm cùng loại</h4>
    </div>
    <div class="content-items">
        <ul class="list">
            <asp:ListView ID="rptSanPham" runat="server" OnItemCommand="rptSanPham_ItemCommand">
                <%--<asp:Repeater ID="rptSanPham" runat="server">--%>
                <%--<ItemTemplate>
                    <li><a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                        <img src='<%#Eval("Image") %>' alt="" /></a>
                        <p class="name">
                            <a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                                <%#Eval("Name") %></p>
                        </a>
                        <p class="view">Lượt xem: <%#Eval("View") %></p>
                        <p class="gia">
                            <%#Eval("Price")%>
                        </p>
                        <p class="chitiet-muahang">
                            <a href="#">
                                <img alt="" src="Images/Styles/muahang.png"></a> <a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                                    <img alt="" src="Images/Styles/chitiet.png"></a>
                        </p>
                    </li>
                </ItemTemplate>--%>
                <ItemTemplate>
                    <li><a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                       <%-- <img src='<%#Eval("Image") %>' alt="" /></a>--%>
                       <asp:Image ID="Image1" ImageUrl='<%#Eval("Image") %>' runat="server" />
                        <p class="name">
                            <%--<asp:HyperLink ID="hplTenSanPham" NavigateUrl='<%#string.Format("~/Chi-tiet-san-pham.aspx?Id={0}",Eval("Id")) %>' runat="server" ><%#Eval("Name") %></asp:HyperLink>--%>
                            <a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                                <asp:Label ID="lblTenSanPham" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
                            </a>
                        </p>
                        <p class="view">
                            Lượt xem:
                            <%#Eval("View") %></p>
                        <p class="gia">
                            <asp:Label ID="lblGia" runat="server" Text='<%#Eval("Price")%>'></asp:Label>
                        </p>
                        <p class="chitiet-muahang">
                            <asp:Button ID="btnMuaHang" runat="server" UseSubmitBehavior="True" CommandName="MuaHang"
                                CausesValidation="True" CssClass="btnMuaHang" CommandArgument='<%#Eval("Id") %>' />
                            <a href='Chi-tiet-san-pham.aspx?Id=<%#Eval("Id") %>'>
                                <img alt="" src="Images/Styles/chitiet.png"></a>
                        </p>
                    </li>
                </ItemTemplate>
                <%--</asp:Repeater>--%>
            </asp:ListView>
        </ul>
        <div class="clear">
        </div>
        <div id="paging">
            <asp:DataPager ID="DataPager1" QueryStringField="page" PageSize="20" PagedControlID="rptSanPham"
                runat="server">
                <%--<Fields>
                <asp:NumericPagerField ButtonType="Link" />
                <asp:NextPreviousPagerField ButtonType="Link" RenderNonBreakingSpacesBetweenControls="true"
                    FirstPageText="Trang đầu" LastPageText="Trang cuối" NextPageText="Tiếp theo"
                    PreviousPageText="Quay lại" ShowFirstPageButton="true" ShowLastPageButton="true"
                    ShowNextPageButton="true" ShowPreviousPageButton="true" />
            </Fields>--%>
                <Fields>
                    <asp:NextPreviousPagerField ShowFirstPageButton="True" ButtonCssClass="paging" ShowNextPageButton="False"
                        PreviousPageText="<<" />
                    <asp:NumericPagerField CurrentPageLabelCssClass="currentpage" NumericButtonCssClass="paging"
                        NextPreviousButtonCssClass="paging" />
                    <asp:NextPreviousPagerField ShowLastPageButton="True" ButtonCssClass="paging" ShowPreviousPageButton="False"
                        NextPageText=">>" />
                </Fields>
            </asp:DataPager>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(".txtSoluong").keypress(function (event) {
        if (event.which == 13) {
            return;
        }
        else return false;

    }); 

</script>
<div class="clear">
</div>
